clear
set more off
cd
capture log close
log using log.log,replace

*******************************************************************************************************************
*								1. Survival Analysis of Urban Commercial Banks' Mergers
*******************************************************************************************************************
use "prov_panel.dta",clear
*----------------Survival-time data settings---------------
stset year, id(provid) failure(integration==1) scale(1)
*-----------------------------Table 2-----------------------------
stcox loggdppc ,r nohr nolog
est store m1

stcox logmrpksd,r nohr nolog
est store m2

stcox gdpgrowth,r nohr nolog
est store m3

stcox logdeppc,r nohr nolog
est store m4

stcox loginvpc,r nohr nolog
est store m5

stcox logindusvapc,r nohr nolog
est store m6

stcox logfinvapc,r nohr nolog
est store m7

stcox loggdppc logmrpksd gdpgrowth logdeppc loginvpc logindusvapc logfinvapc, r nohr nolog
est store m8

outreg2 [m1 m2 m3 m4 m5 m6 m7 m8] using Table02.xls,replace bdec(3) sdec(3) 



*******************************************************************************************************************
*								2. Analysis using the City-year Panel
*******************************************************************************************************************
use "city_panel.dta",clear
xtset cityid year

****Set the Year Dummies****
gen post_integration = (year>=year_shock)
gen gap = year - year_shock
forvalues l = 0/5 {
	gen post`l' = gap==`l'
}
forvalues l = 1/2 {
	gen pre`l' = gap==-`l'
}


****Set the year 0 as the benchmark****
drop post0
gen zero=0


****Define the Time Window to Conduct the Event Study****
gen window25 = (gap>=-2 & gap<=5)
replace window25 = 1 if gap == .


*-----------------------------Table 3 Urban Commercial Banks' Mergers and Integration of Local Capital Markets-----------------------------
reghdfe loginvpercap l.logsavingpercap, ab( cityid year ) cluster( cityid )
est store m1

reghdfe loginvpercap c.l.logsavingpercap#c.post_integration post_integration l.logsavingpercap,ab( cityid year ) cluster( cityid )
est store m2

reghdfe loginvpercap l.logsavingpercap l.loggdp_per_capita l.logpop,ab( cityid year ) cluster( cityid )
est store m3

reghdfe loginvpercap c.l.logsavingpercap#c.post_integration post_integration l.logsavingpercap l.loggdp_per_capita l.logpop,ab( cityid year ) cluster( cityid )
est store m4

outreg2 [m1 m2 m3 m4] using Table03.xls,replace bdec(3) sdec(3) 


*-----------------------------Table 4 UCBs' Mergers and Heterogeneous Investment Response: City-level Evidence-----------------------------
reghdfe loginv c.highmrpk_share#c.post_integration post_integration l.loggdp_per_capita l.logpop,ab( cityid year ) cluster( province_year )
est store m1

reghdfe loginvpercap c.highmrpk_share#c.post_integration post_integration l.loggdp_per_capita l.logpop,ab( cityid year ) cluster( province_year )
est store m2

reghdfe loginv c.highmrpk_share#c.post_integration post_integration l.loggdp_per_capita l.logpop,ab( cityid provid#year ) cluster( province_year )
est store m3

reghdfe loginvpercap c.highmrpk_share#c.post_integration post_integration l.loggdp_per_capita l.logpop,ab( cityid provid#year ) cluster( province_year )
est store m4

outreg2 [m1 m2 m3 m4] using Table04.xls,replace bdec(3) sdec(3) 



*-----------------------------Figure 4: The Correlation between Local Investment and Local Deposits-----------------------------
binscatter  loginvpercap logsavingpercap,scheme(plotplain) xtitle("Log of Deposits p.c.") ytitle("Log of Investments p.c.")




*-----------------------------Figure 5 Dynamic Effects of Local Banking Integration on Capital Reallocation: City-level Evidence-----------------------------
reghdfe loginvpercap c.highmrpk_share#c.pre2 c.highmrpk_share#c.pre1 c.highmrpk_share#c.zero c.highmrpk_share#c.post1 c.highmrpk_share#c.post2 c.highmrpk_share#c.post3 c.highmrpk_share#c.post4 c.highmrpk_share#c.post5 pre2 pre1 post1 post2 post3 post4 post5 l.loggdp_per_capita l.logpop if window25==1,ab( cityid year provid##c.year ) cluster( province_year )

est store d1

coefplot (d1,label("Dependent Variable: log (Investments per Capita)") offset(0) pstyle(p2)), keep( c.highmrpk_share#c.pre2 c.highmrpk_share#c.pre1  c.highmrpk_share#c.zero c.highmrpk_share#c.post1 c.highmrpk_share#c.post2 c.highmrpk_share#c.post3 c.highmrpk_share#c.post4 c.highmrpk_share#c.post5)  omitted coeflabels(c.highmrpk_share#c.pre2="-2" c.highmrpk_share#c.pre1="-1"  c.highmrpk_share#c.zero="0"  c.highmrpk_share#c.post1="+1" c.highmrpk_share#c.post2 = "+2"  c.highmrpk_share#c.post3=  "+3" c.highmrpk_share#c.post4="+4"  c.highmrpk_share#c.post5="+5") vertical yline(0, lp(dash) lcolor(gray)) xline(3, lp(dash) lcolor(gray)) xtitle("Years relative to Local Banking Integration")  ytitle("Regression coefficients") ylabel(-2(0.5)2,nogrid) ciopts(recast(rcap)) plotregion(style(none)) graphregion(color(white))  legend(position(6)) level(90) scheme(meta)


*******************************************************************************************************************
*								3. Analysis using the Firm-year Panel
*******************************************************************************************************************
use "firm_panel.dta",clear

*-----------------------------Table A1: Summary Statistics-----------------------------
sum2docx logcapital age logmrpk logdebt loginv nsoe if year_shock~=. using 1.docx, ///
replace stats(N mean(%9.3f) sd(%9.3f) median(%9.3f) p25(%9.3f) p75(%9.3f) max(%9.3f) min(%9.3f)) 

sum2docx logcapital age logmrpk logdebt loginv nsoe if year_shock==. using 2.docx, ///
replace stats(N mean(%9.3f) sd(%9.3f) median(%9.3f) p25(%9.3f) p75(%9.3f) max(%9.3f) min(%9.3f)) 


****Set the Year Dummies****
gen post_integration = (year>=year_shock)
gen gap = year - year_shock
forvalues l = 0/4 {
	gen post`l' = gap==`l'
}
forvalues l = 1/2 {
	gen pre`l' = gap==-`l'
}


****Set the year 0 as the benchmark****
drop post0
gen zero=0


****Define the Time Window to Conduct the Event Study****
gen window24 = (gap>=-2 & gap<=4)
replace window24 = 1 if gap == .

*-----------------------------Table 5: Local Banking Integration and Capital Reallocation-----------------------------
reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year) cluster( provid ind2digit )
est store m1

reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age) cluster( provid ind2digit )
est store m2

reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year) cluster( provid ind2digit )
est store m3

reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m4

outreg2 [m1 m2 m3 m4] using Table05.xls,replace bdec(3) sdec(3) 

*-----------------------------Figure 6: Dynamic Regression Coefficients-----------------------------

*-----------------------------Figure 6 Panel A-----------------------------
reghdfe logcapital c.pre2#c.highmrpkpre04  c.pre1#c.highmrpkpre04 zero c.post1#c.highmrpkpre04   c.post2#c.highmrpkpre04 c.post3#c.highmrpkpre04 c.post4#c.highmrpkpre04 pre2 pre1 post1 post2 post3 post4 if window24==1,ab(id capquartile#year ind4digit#year city_id#year) cluster( provid ind2digit )
est store d1

coefplot (d1,label("Dependent Variable: log (Physical Capital)") offset(0) pstyle(p2)), keep( c.pre2#c.highmrpkpre04  c.pre1#c.highmrpkpre04 zero c.post1#c.highmrpkpre04   c.post2#c.highmrpkpre04 c.post3#c.highmrpkpre04 c.post4#c.highmrpkpre04)  omitted coeflabels(c.pre2#c.highmrpkpre04="-2" c.pre1#c.highmrpkpre04="-1" zero="0"  c.post1#c.highmrpkpre04="+1" c.post2#c.highmrpkpre04 = "+2"  c.post3#c.highmrpkpre04=  "+3" c.post4#c.highmrpkpre04="+4") vertical yline(0, lp(dash) lcolor(gray)) xline(3, lp(dash) lcolor(gray)) xtitle("Years relative to Local Banking Integration")  ytitle("Regression coefficients") ylabel(-0.1(0.05)0.1,nogrid) ciopts(recast(rcap)) plotregion(style(none)) graphregion(color(white))  legend(position(6)) level(95) scheme(meta)

*-----------------------------Figure 6 Panel B-----------------------------
reghdfe loginv c.pre2#c.highmrpkpre04  c.pre1#c.highmrpkpre04 zero c.post1#c.highmrpkpre04   c.post2#c.highmrpkpre04 c.post3#c.highmrpkpre04 c.post4#c.highmrpkpre04 pre2 pre1 post1 post2 post3 post4 if window24==1,ab(id capquartile#year ind4digit#year city_id#year) cluster(  provid ind2digit  )

est store d2

coefplot (d2,label("Dependent Variable: log (Investments)") offset(0) pstyle(p2)), keep(c.pre2#c.highmrpkpre04  c.pre1#c.highmrpkpre04 zero c.post1#c.highmrpkpre04   c.post2#c.highmrpkpre04 c.post3#c.highmrpkpre04 c.post4#c.highmrpkpre04 )  omitted coeflabels(c.pre2#c.highmrpkpre04="-2" c.pre1#c.highmrpkpre04="-1" zero="0"  c.post1#c.highmrpkpre04="+1" c.post2#c.highmrpkpre04 = "+2"  c.post3#c.highmrpkpre04=  "+3" c.post4#c.highmrpkpre04="+4") vertical yline(0, lp(dash) lcolor(gray)) xline(3, lp(dash) lcolor(gray)) xtitle("Years relative to Local Banking Integration")  ytitle("Regression coefficients") ylabel(-0.5(0.1)0.5,nogrid) ciopts(recast(rcap)) plotregion(style(none)) graphregion(color(white))  legend(position(6)) level(95) scheme(meta)



*-----------------------------Table 6:  Other Firm-level Responses-----------------------------
reghdfe loginv c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m1

reghdfe logmrpk c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m2

reghdfe lending_extensive c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m3

reghdfe logdebt c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m4

reghdfe longtermdebtshare c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m5

outreg2 [m1 m2 m3 m4 m5] using Table06.xls,replace bdec(3) sdec(3) 

*-----------------------------Table 7:  Robustness Check: Capital Reallocation Across Cities-----------------------------
reghdfe logcapital c.post_integration#c.mrpkpre04_city1 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m1

reghdfe logmrpk c.post_integration#c.mrpkpre04_city1 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m2

reghdfe logcapital c.post_integration#c.mrpkpre04_city2 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m3

reghdfe logmrpk c.post_integration#c.mrpkpre04_city2 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m4

outreg2 [m1 m2 m3 m4] using Table07.xls,replace bdec(3) sdec(3) 

*-----------------------------Table C1: Difference Between Peer and Control Group following the Banking Integration-----------------------------
use "control_vs_peer.dta",clear
gen post_integration=(year>=year_shock)
reghdfe logcapital post_integration ,ab(id capquartile#year) cluster( provid ind2digit )
est store m1

reghdfe logmrpk post_integration ,ab(id capquartile#year) cluster( provid ind2digit  )
est store m2

reghdfe logdebt post_integration ,ab(id capquartile#year) cluster( provid ind2digit  )
est store m3

outreg2 [m1 m2 m3] using TableC1.xls,replace bdec(3) sdec(3) 

*-----------------------------Figure C2: Effectiveness of PSM-----------------------------
use "city_matching.dta",clear
psmatch2 treat loggdppc logloanpc logsavingpc fiscalbudget loginvpc lightintensity industrialshare    tertiaryshare gdpgrowth fdi,n(1) cal(0.01) ate ties logit common

pstest loggdppc logloanpc logsavingpc fiscalbudget loginvpc lightintensity industrialshare    tertiaryshare gdpgrowth fdi,both graph scheme(meta) plotregion(style(none)) graphregion(color(white))  legend(position(6) ring(1))

*-----------------------------Table 8: Accounting for Potential Spillover Effects into "Peer" Prefectures-----------------------------
*-----------------------------Table 8 Panel A-----------------------------
use "firm_clean_without_matching.dta",clear
gen post_integration = (year>=year_shock)

reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m1

reghdfe logmrpk c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m2

reghdfe logdebt c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m3

reghdfe longtermdebtshare c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m4
*-----------------------------Table 8 Panel B-----------------------------

use "firm_clean_matching.dta",clear
gen post_integration = (year>=year_shock)

reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m5

reghdfe logmrpk c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m6

reghdfe logdebt c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m7

reghdfe longtermdebtshare c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m8
outreg2 [m1 m2 m3 m4 m5 m6 m7 m8] using Table08.xls,replace bdec(3) sdec(3) 

*-----------------------------Table 9: Accounting for Potential Bias in Staggered Difference-in-Differences-----------------------------
*** Create Each Dataset within Respective Reform Vintage***
local x 2005 2007 2009 2010 2011 2012
foreach l of local x {
  use "firm_panel.dta",clear 
	keep if year>=`l'-3 & year<=`l'+3
    keep if year_shock==`l' | year_shock==.
	gen reformvintage=`l'
  save shock`l',replace
}

local y 2007 2009 2010 2011 2012
use "shock2005",clear
foreach l of local y {
  append using shock`l'.dta
  save firm_stacked_panel,replace
}
gen post_integration=(year>=year_shock)

reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m1

reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year reformvintage#year) cluster( provid ind2digit )
est store m2

reghdfe logmrpk c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m3

reghdfe logmrpk c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year reformvintage#year) cluster( provid ind2digit )
est store m4

outreg2 [m1 m2 m3 m4] using Table09.xls,replace bdec(3) sdec(3) 

*-----------------------------Table 10: Other Robustness Checks Difference-in-Differences-----------------------------
use "firm_panel.dta",clear
gen post_integration=(year>=year_shock)
*-----------------------------Table 10 Panel A: Robustness to More Parsimonious Controls-----------------------------
reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year c.wlev_pretreatment##year c.wliquidity_pretreatment##year c.wprofit_pretreatment##year) cluster( provid ind2digit )
est store m1

reghdfe logmrpk c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year c.wlev_pretreatment##year c.wliquidity_pretreatment##year c.wprofit_pretreatment##year) cluster( provid ind2digit )
est store m2

*-----------------------------Table 10 Panel B: Robustness to Different Clusters-----------------------------
reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( city_id )
est store m3

reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid )
est store m4

reghdfe logmrpk c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( city_id )
est store m5

reghdfe logmrpk c.post_integration#c.highmrpkpre04 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid )
est store m6

*-----------------------------Table 10 Panel C: Robustness to Alternative MRPK Cut-Offs-----------------------------
reghdfe logcapital c.post_integration#c.tercile3 c.post_integration#c.tercile2 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit)
est store m7

reghdfe logmrpk c.post_integration#c.tercile3 c.post_integration#c.tercile2 post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit)
est store m8
outreg2 [m1 m2 m3 m4 m5 m6 m7 m8] using Table10.xls,replace bdec(3) sdec(3) 

*-----------------------------Table 11: SOEs versus NON-SOEs-----------------------------
reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration if nsoe==0,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m1
reghdfe logcapital c.post_integration#c.highmrpkpre04 post_integration if nsoe==1,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m2
outreg2 [m1 m2] using Table11.xls,replace bdec(3) sdec(3) 

*-----------------------------Table 12: Exposure to Local Banking System and Capital Reallocation-----------------------------
reghdfe logcapital c.post_integration#c.highmrpkpre04#c.lognum5km c.post_integration#c.highmrpkpre04  c.post_integration#c.lognum5km post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m1

reghdfe logcapital c.post_integration#c.highmrpkpre04#c.lognum10km c.post_integration#c.highmrpkpre04  c.post_integration#c.lognum10km post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m2

reghdfe logcapital c.post_integration#c.highmrpkpre04#c.localbank5km_pre c.post_integration#c.highmrpkpre04  c.post_integration#c.localbank5km_pre post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m3

reghdfe logcapital c.post_integration#c.highmrpkpre04#c.localbank10km_pre c.post_integration#c.highmrpkpre04  c.post_integration#c.localbank10km_pre post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m4
use "firm_clean_matching.dta",clear
gen post_integration = (year>=year_shock)

reghdfe logcapital c.post_integration#c.highmrpkpre04#c.lognum10km c.post_integration#c.highmrpkpre04  c.post_integration#c.lognum10km post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit )
est store m5

outreg2 [m1 m2 m3 m4 m5] using Table12.xls,replace bdec(3) sdec(3) 

*-----------------------------Table 13: Heterogeneous Effect of Local Banking Integration on Firms' Financing Constraints-----------------------------
use "firm_panel.dta",clear
gen post_integration=(year>=year_shock)

xtset id year
reghdfe loginv c.post_integration#c.highmrpkpre04#c.l.wcf2asset c.post_integration#c.highmrpkpre04 c.post_integration#c.l.wcf2asset c.highmrpkpre04#c.l.wcf2asset l.wcf2asset post_integration,ab(id capquartile#year) cluster( provid ind2digit)
est store m1

reghdfe loginv c.post_integration#c.highmrpkpre04#c.l.wcf2asset c.post_integration#c.highmrpkpre04 c.post_integration#c.l.wcf2asset c.highmrpkpre04#c.l.wcf2asset l.wcf2asset post_integration,ab(id capquartile#year age) cluster( provid ind2digit)
est store m2

reghdfe loginv c.post_integration#c.highmrpkpre04#c.l.wcf2asset c.post_integration#c.highmrpkpre04 c.post_integration#c.l.wcf2asset c.highmrpkpre04#c.l.wcf2asset l.wcf2asset post_integration,ab(id capquartile#year age ind4digit#year) cluster( provid ind2digit)
est store m3

reghdfe loginv c.post_integration#c.highmrpkpre04#c.l.wcf2asset c.post_integration#c.highmrpkpre04 c.post_integration#c.l.wcf2asset c.highmrpkpre04#c.l.wcf2asset l.wcf2asset post_integration,ab(id capquartile#year age ind4digit#year provid#year) cluster( provid ind2digit)
est store m4

outreg2 [m1 m2 m3 m4] using Table13.xls,replace bdec(3) sdec(3) 

*-----------------------------Table 14: Responsiveness of Investment to Shocks on Neighboring Cities' Deposits-----------------------------
gen pre_integration = (year < year_shock)
reghdfe loginv neighboring_growth_log, ab(id ind4digit#year capquartile#year provid#year age) cluster( provid ind2digit )
est store m1

reghdfe loginv c.pre_integration#c.neighboring_growth_log c.post_integration#c.neighboring_growth_log pre_integration post_integration neighboring_growth_log, ab(id ind4digit#year capquartile#year provid#year age) cluster( provid ind2digit )
est store m2

reghdfe loginv c.post_integration#c.neighboring_growth_log post_integration neighboring_growth_log, ab(id ind4digit#year capquartile#year provid#year age) cluster( provid ind2digit )
est store m3

outreg2 [m1 m2 m3] using Table14.xls,replace bdec(3) sdec(3) 

*-----------------------------Table 15: Aggregate MRPK Dispersion-----------------------------

use "prov_ind_dispersion.dta",clear
gen post_integration = (year >= year_shock)

reghdfe disper_80_20 post_integration ,ab( ind2digit#year prov_ind2digit ) cluster( prov_year )
est store m1

reghdfe disper_75_25 post_integration ,ab( ind2digit#year prov_ind2digit ) cluster( prov_year )
est store m2

reghdfe logmrpk_var post_integration ,ab( ind2digit#year prov_ind2digit ) cluster( prov_year )
est store m3

use "city_ind_dispersion.dta",clear
gen post_integration = (year >= year_shock)

reghdfe logmrpk_city_80_20 post_integration ,ab( ind2digit#year city_ind2digit ) cluster( prov_year )
est store m4

reghdfe logmrpk_city_75_25 post_integration ,ab( ind2digit#year city_ind2digit ) cluster( prov_year )
est store m5

reghdfe logmrpk_var_city post_integration ,ab( ind2digit#year city_ind2digit ) cluster( prov_year )
est store m6

outreg2 [m1 m2 m3 m4 m5 m6] using Table15.xls,replace bdec(3) sdec(3) 

*----------------------------Local Banking Geographical Concentration Index------------------------------
use "local_bank_hhi.dta",clear
*----------------------------Figure B2: Dynamics of Local Banking Geographical Concentration Index------------------------------
binscatter weighted_hhi year,line(none) xlabel(1998(1)2015) scheme(plotplain)

*----------------------------Figure 7: Local Banking Integration and Development------------------------------

binscatter2 loghhi loggpc_real ,  scheme(plotplain) ab(year ) xtitle("log of real GDP p.c.") ytitle("log of HHI")
binscatter2 loghhi logmrpk_scale_prov_sd , scheme(plotplain) ab(year) xtitle("std(Log of MRPK)") ytitle("log of HHI")
